This invention relates generally to obtaining synchronization among the time-of-day (TOD) clocks in a plurality of processing units, commonly called CPUs, which may be interconnected at a single installation, such as in a multiprocessing system.
For example, the TOD clock in an IBM S/370 CPU operates on a calendar basis, e.g. 143 years without recycling, and it is generally set to provide the calendar date and time with an accuracy of about a second from a standard time origin, which usually is Jan. 1, 1900, 0 AM Greenwich Mean Time (GMT). In using the standard epoch, the highest-order bit of the TOD clock is flipped to its set state on May 11, 1971 at 11:56:53.685248 A.M. GMT. A program can test the highest-order bit to determine if the TOD clock is using the standard epoch.
The operation of any TOD clock must not be affected or inhibited by any normal activity or event in the system. The clock continues to run whether its CPU is in wait to stop state or in the instruction-step, single cycle, or test mode; and the clock operation is not affected by system clear resets, initial program load procedure, or any programmed operation except the protected set clock operation. In some implementations the clock can even run with CPU power off.
A synchronization problem occurs when plural TOD clocks exist in a multiprocessing system; this usually occurs because CPUs are manufactured to operate in a uniprocessing system as well as in a multiprocessing system and hence each CPU may contain a TOD clock. It is not considered a satisfactory solution to have the clocks operate independently in separate CPU's in a multiprocessing system, because their different time values would be a source of error in CPU intermixed time computation. Nor is it satisfactory to have one clock for all CPUs, because the system time must be totally reliable at all times, and if one clock fails at least one other must be available.
Thus in a multiprocessing system, such as an IBM S/370 MP system, it is desirable that all of its TOD clocks provide the identical time-of-day. Each CPU's separate TOD clock must be integrated into the multiprocessing system in such a manner that all TOD clocks provide the same time. Thus the crystal oscillator of one of the TOD clocks is converted as a single source of oscillator pulses provided to all TOD clocks, so that they will stay in synchronism, once gotten into synchronism by operation of this invention.
It is essential in a multiprocessing system to have precisely the same time available to any CPU from the TOD clock in the same or any other CPU in the system.
It is well known in the art that a TOD clock in a uniprocessing system may be set within a one second accuracy by manually starting the clock at a predetermined time set into it. In an IBM S/370 system, this is done by a computer operator initiating a program to continuously attempt to set a TOD clock to an operator requested time. The operator then manually depresses the handle of a TOD clock switch on the system console to its "enable-set" position at the predetermined time. When the switch is depressed it enables the program to set the time into the TOD clock and starts it running. The switch is then put in its "secure" position so that the state of the TOD clock cannot thereafter be changed by any program operation.
This manual time setting method cannot be used to synchronize the TOD clocks in a multiprocessing system, because the manual operation only has an accuracy of about one second, and synchronization requires the TOD clocks to have the same time within one millionth of a second, which is well beyond the time in which a human can react. Thus the manual method can be used to set one of the TOD clocks in the system to an external standard, e.g. radio station WWV; but then the other clocks must be synchronized with the set clock by another method, such as by this invention.
If the above procedure were modified such that the TOD clocks in the system can be set when the switch is depressed, but do not start until the switch is released, then it would be possible to set all clocks to the same value and then let them start simultaneously. However, such a procedure requires that all clocks be set in order to get them in synchronism. If a CPU with an unsynchronized clock is configured into the system, the real time continuity of the clocks already in the configuration is severly affected if the operator must be depended upon to reset all the clocks.
Some of the situations which can be solved by this invention are the following:
1. When a multiprocessing system is initially installed, or when power has been off on all clocks, all clocks in the system are synchronized to the identical date and time value.
2. When an additional CPU is configured into the system, or when circuit failure, maintenance, or redesign requires any TOD clock to be temporarily removed from system operation, the TOD clock is synchronized to the operational TOD clock(s) in the system without affecting their current settings.
While the multiprocessing system is normally operating, it does not make much difference which operational clock is selected for use by any program, since the operational clocks are synchronized together.